package cn.edu.sanxiau.www.servier.impl;

import java.util.List;

import cn.edu.sanxiau.www.dao.PermissionDao;
import cn.edu.sanxiau.www.dao.RoleDao;
import cn.edu.sanxiau.www.dao.impl.PermissionDaoImpl;
import cn.edu.sanxiau.www.dao.impl.RoleDaoImpl;
import cn.edu.sanxiau.www.model.Permission;
import cn.edu.sanxiau.www.servier.PermissionService;

public class PermissionServiceImpl implements PermissionService {
    // 注入数据访问对象ע
    PermissionDao permissionDao = new PermissionDaoImpl();

    @Override
    public List<Permission> queryAllPermission() {
        return permissionDao.queryAllPermission();
    }

    @Override
    public int addPermissionByPermission(Permission permission) {
        return permissionDao.addPermissionByPermission(permission);
    }

    @Override
    public int deletePermissionByPermission_id(int permission_id) {
        return permissionDao.deletePermissionByPermission_id(permission_id);
    }

    @Override
    public Permission queryPermissionByPermission_id(int permission_id) {
        return permissionDao.queryPermissionByPermission_id(permission_id);
    }

    @Override
    public int updatePermissionByPermission(Permission permission) {
        return permissionDao.updatePermissionByPermission(permission);
    }

    @Override
    public List<Permission> queryXZPermissionByRole_id(int role_id) {
        return permissionDao.queryXZPermissionByRole_id(role_id);
    }

    @Override
    public List<Permission> queryUser_xz_permissionByUser_id(int user_id) {
        return permissionDao.queryUser_xz_permissionByUser_id(user_id);
    }

    @Override
    public List<Permission> queryXZPermissionAllSonByP_id(int p_id) {
        return permissionDao.queryXZPermissionAllSonByP_id(p_id);
    }

}
